/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef PLJAVA_FILE_CONST_H
#define PLJAVA_FILE_CONST_H

namespace PLSDK {

/**
 * Base class for all const table elements.
 */
class PLJavaConst {
public:
    /**
     * Types from the constant table.
     */
    enum ConstTypes {
        /**
         * CONSTANT_Class
         */
        ConstTypesClass                 = 7,
        /**
         * CONSTANT_Fieldref
         */
        ConstTypesFieldref              = 9,
        /**
         * CONSTANT_Methodref
         */
        ConstTypesMethodref             = 10,
        /**
         * CONSTANT_InterfaceMethodref
         */
        ConstTypesInterfaceMethodref    = 11,
        /**
         * CONSTANT_String
         */
        ConstTypesString                = 8,
        /**
         * CONSTANT_Integer
         */
        ConstTypesInteger               = 3,
        /**
         * CONSTANT_Float
         */
        ConstTypesFloat                 = 4,
        /**
         * CONSTANT_Long
         */
        ConstTypesLong                  = 5,
        /**
         * CONSTANT_Double
         */
        ConstTypesDouble                = 6,
        /**
         * CONSTANT_NameAndType
         */
        ConstTypesNameAndType           = 12,
        /**
         * CONSTANT_Utf8
         */
        ConstTypesUtf8                  = 1
    };
    /**
     * Constructor.
     */
    PLJavaConst();
    /**
     * Get the type of the element.
     */
    inline PLJavaConst::ConstTypes type() const;
protected:
    PLJavaConst::ConstTypes m_type;
};

PLJavaConst::ConstTypes PLJavaConst::type() const {
    return m_type;
}

}

#endif
